package net.expectx.micro.shop.api.common;


import net.expectx.common.single.base.BaseResult;
import net.expectx.common.single.base.BaseResultConstants;

/**
 * @author lijian
 */
public class ApiResult extends BaseResult {


    public ApiResult(Boolean success, ApiResultConstants apiResultConstants, Object data) {
        super(success, apiResultConstants.getCode(),apiResultConstants.getMessage(), data);
    }
    public ApiResult(BaseResult result) {
        super(result.isSuccess(), result.getCode(),result.getMessage(), result.getData());
    }
    public ApiResult(Boolean success, Integer code, String message, Object data) {
        super(success,code, message, data);
    }
    public ApiResult(boolean success) {
        super(
                success,
                success?BaseResultConstants.SUCCESS.getCode():BaseResultConstants.FAILED.getCode(),
                success?BaseResultConstants.SUCCESS.getMessage():BaseResultConstants.FAILED.getMessage(),
                null);
    }
}
